<%@ page language="java" import="java.util.*,com.shop.dao.*,com.shop.domain.*" contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!doctype html>
<html lang="cmn-Hans-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<!--引入bootstrap的CSS文件 -->
<link rel="stylesheet" href="../css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="../css/bootstrap-theme.min.css"
	type="text/css" />
<link rel="stylesheet" href="../css/admin.css" />
<!--引入jquery的js文件-->

<script type="text/javascript" src="../js/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="../js/bootstrap.js"></script>
<script src="../js/admin.js"></script>
</head>
<body>
    <%!
    ArrayList<Kind> listKind;
    %>
    <%
    KindDao kd = new KindDao();
    listKind = kd.findAll();
    session.setAttribute("listKind", listKind);
    %>
    <div class="container" style="margin-bottom:0">
	<h3>添加商品</h3>
	<form action="AddProduct" id="form" method="post"	class="form-horizontal" role="form">
		<div class="form-group">
			<label class="col-sm-2 control-label">商品名称</label>
			<div class="col-sm-4"><input class="form-control" id="disabledInput" type="text" name="pName" type="text" /></div>
			</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">商品描述</label>
				<div class="col-sm-4"><textarea class="form-control" name="pDesc"cols="30" rows="10"></textarea></div>
			</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">商品库存</label>
				<div class="col-sm-4"><input class="form-control" id="disabledInput" type="text" name="pNum" type="number" /></div>
			</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">商品生产日期</label>
				<div class="col-sm-4"><input class="form-control" id="disabledInput" type="text" name="pubTime" type="date" /></div>
			</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">商品保质期(天)</label>
				<div class="col-sm-4"><input class="form-control" id="disabledInput" type="text" name="pKeepTime" type="number" /></div>
			</div>
		<div class="form-group">
			<label class="col-sm-2 control-label">商品图片</label>
			<div class="col-sm-6">
			<table id="form1" action="" method="post" enctype="multipart/form-data">
				<label class="col-sm-3 control-label"></span><input name="pImage" id="imgOne" type="file" from="from1" onchange=""/></label>
			</table>
			</div>
		</div>
		<div class="form-group col-sm-10">
			<label class="col-sm-2 control-label">商品类别</label>
			<div class="col-sm-4"><select  name="kId" from="from">
				        <c:forEach var="kind" items="${sessionScope.listKind}">
				            <option value="${kind.id}">${kind.kName}</option>
				        </c:forEach>
				</select></div>
			</div>
		<div class="form-group col-sm-10">
			<label class="col-sm-2 control-label">网站价格</label>
				<div class="col-sm-2"><input class="form-control" name="iPrice" type="text" /></div>
			</div>
		<div class="form-group col-sm-10">
			<label class="col-sm-2 control-label">市场价格</label>
			<div class="col-sm-2"><input class="form-control" name="mPrice" type="text" /></div>
			</div>
		<div class="form-group col-sm-10">
			<label class="col-sm-2 control-label">是否是热图</label>
				<div class="col-sm-4">
					<label class="radio-inline">
					<input type="radio" name="isHot" value="是">是 
					</label>
					<label class="radio-inline">
					<input type="radio" name="isHot" value="否">否
					</label>
				</div>
			</div>
		<div class="form-group col-sm-10">
			<label class="col-sm-2 control-label">是否在首页显示</label>
				<div class="col-sm-4">
					<label class="radio-inline">
					<input type="radio" name="isShow" value="是">是 
					</label>
					<label class="radio-inline">
					<input type="radio" name="isShow" value="否">否
					</label>
				</div>
			</div>
			 <div class="form-group col-sm-10">
			 <label class="col-sm-2 control-label"></label>
			 
			<div class="col-sm-6">
			<button class="btn btn-default" type="submit" form="form">提交</button>
			</div>
			</div>
	</form>
	</div>
</body>

</html>